using System;
using HBCode.BusinessLogic.Base;
using HBCode.BusinessLogic.Validations;

namespace HBCode.BusinessLogic.Entities
{
    public class Customer : EntityBase
    {
        private long _CustomerID;
        public long CustomerID
        {
            get
            {
                return _CustomerID;
            }
            set
            {
                if (_CustomerID == value)
                    return;
                OnPropertyChanging("CustomerID");
                _CustomerID = value;
                OnPropertyChanged("CustomerID");
            }
        }

        private string _CustomerName;

        [ValidateAttribute(IsRequired = true)]
        public string CustomerName
        {
            get
            {
                return _CustomerName;
            }
            set
            {
                if (_CustomerName == value)
                    return;
                OnPropertyChanging("CustomerName");
                _CustomerName = value;
                OnPropertyChanged("CustomerName");
            }
        }

        private Nullable<DateTime> _DOB;
        public Nullable<DateTime> DOB
        {
            get
            {
                return _DOB;
            }
            set
            {
                if (_DOB == value)
                    return;
                OnPropertyChanging("DOB");
                _DOB = value;
                OnPropertyChanged("DOB");
            }
        }

        private string _Email;

        [ValidateAttribute(IsRequired = true, Type = ValidateType.Email)]
        public string Email
        {
            get
            {
                return _Email;
            }
            set
            {
                if (_Email == value)
                    return;
                OnPropertyChanging("Email");
                _Email = value;
                OnPropertyChanged("Email");
            }
        }

        private string _Phone;

        [ValidateAttribute(IsRequired = true, Type = ValidateType.Phone)]
        public string Phone
        {
            get
            {
                return _Phone;
            }
            set
            {
                if (_Phone == value)
                    return;
                OnPropertyChanging("Phone");
                _Phone = value;
                OnPropertyChanged("Phone");
            }
        }
    }
}

